import time
file1 = open("m1_sorted.txt")

ts = time.time()
a = file1.readlines()
s = [int (i) for i in a]
for i in range (len(s)-1):
    for j in range (len(s)-2, i-1, -1):
        if s[j+1] < s[j]:
            s[j], s[j+1] = s[j+1], s[j]
tf = time.time()
t = round ((tf - ts) * 1000)
print("m1_sorted", t, "milliseconds")

file2 = open("m2_reverse.txt")
ts = time.time()
a = file2.readlines()
s = [int (i) for i in a]
for i in range (len(s)-1):
    for j in range (len(s)-2, i-1, -1):
        if s[j+1] < s[j]:
            s[j], s[j+1] = s[j+1], s[j]
tf = time.time()
t = round ((tf - ts) * 1000)
print("m2_reverse.txt", t, "milliseconds")

file3 = open("m3_shuffle.txt")
ts = time.time()
a = file3.readlines()
s = [int (i) for i in a]
for i in range (len(s)-1):
    for j in range (len(s)-2, i-1, -1):
        if s[j+1] < s[j]:
            s[j], s[j+1] = s[j+1], s[j]
tf = time.time()
t = round ((tf - ts) * 1000)
print("m3_shuffle.txt", t, "milliseconds")

